<?php

if (isset($config)) {
	$loadTime = getTick();

	if (!isset($_GET["page"])) $page = $config["home"];
	else $page = $_GET["page"];
	
	$pageTitle = $config["page_title"] . " | " . str_replace("_", " ", $page);
	
	$pageMenu = getPageContent($config["special_page_prefix"] . $config["menu_page"]);
	$pageSideMenu = getPageContent($config["special_page_prefix"] . $config["menu_side_page"]);	
	
	$pageContent = getPageContent($page);
	
	$loadTime = getTick() - $loadTime;
	$pageInfo = formatPageInfo($page, getPageDate($page), $loadTime);
	
	include(  $config["theme_dir"] . "/"
			. $config["theme"] . "/"
			. $config["theme_view"] . ".html" );
} else {
	include("function.php");
}

?>